﻿#region Copyright RenGuiYou. All rights reserved.
//=====================================================
// NeatlyFrameWork
// Author:      RenGuiyou
// Feedback: 	mailto:750539605@qq.com
//=====================================================
#endregion

using UnityEngine;

namespace Neatly.UI
{
    public class NInternational : MonoBehaviour
    {
        [SerializeField] public bool IsImage = false;
        [SerializeField] private string m_SpriteName1;
        [SerializeField] private string m_SpriteName2;
        [SerializeField] public bool IsAnimation = false;
        [SerializeField] private AnimationClip m_Clip1;
        [SerializeField] private AnimationClip m_Clip2;

        void Awake()
        {
            if (IsImage)
            {
                var component = GetComponent<NImage>();
                component.SetSpriteName(NeatlyUI.IsRtlAction() ? m_SpriteName2 : m_SpriteName1);
            }
            if (IsAnimation)
            {
                var component = GetComponent<Animation>();
                component.clip = NeatlyUI.IsRtlAction() ? m_Clip2 : m_Clip1;
            }
        }
    }
}